package br.edu.fapi.gestao.pg.repositorio;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import br.edu.fapi.gestao.pg.dominio.Telessala;
import br.edu.fapi.gestao.pg.mapeador.MapeadorTelessala;

@Repository(value = "repositorioTelessala")
public class RepositorioTelessalaImpl {

	@Autowired
	private JdbcTemplate jdbcTemplate;
					  
	@Resource(name = "consultasTelessala")
	private Map<String,String> sqlQueries;
	
	@Resource(name = "mapeadorTelessala")
	private MapeadorTelessala mapeadorTelessala;
	
	public List<Telessala> listarTelessalas() {
		String sqlString = sqlQueries.get("listarTelessalas");
		return jdbcTemplate.query(sqlString, mapeadorTelessala, new Object[] {});
	}

}
